import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:moose_app/ui/values/values.dart';

class ATHRecommendBanner extends StatelessWidget {
  final bannerImages = [
    "https://gitee.com/shizidada/moose-resource/raw/master/banner/banner-5.jpg",
    "https://gitee.com/shizidada/moose-resource/raw/master/banner/banner-4.jpg",
    "https://gitee.com/shizidada/moose-resource/raw/master/banner/banner-1.jpg",
    "https://gitee.com/shizidada/moose-resource/raw/master/banner/banner-3.jpg",
    "https://gitee.com/shizidada/moose-resource/raw/master/banner/banner-2.jpg",
  ];

  @override
  Widget build(BuildContext context) {
    return Container(
      height: kSize320,
      child: ClipRRect(
        borderRadius: BorderRadius.all(Radius.circular(kSize20)),
        child: Swiper(
          itemCount: bannerImages.length,
          itemBuilder: (BuildContext context, int position) {
            String imagePath = bannerImages[position];
            return CachedNetworkImage(
                imageUrl: imagePath, fit: BoxFit.fitWidth);
          },
          loop: false,
          scrollDirection: Axis.horizontal,
        ),
      ),
    );
  }
}
